/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rule;

import score.Score;

/**
 *
 * @author Daniel Gribel
 */
public abstract class Rule implements RuleInterface {
    private int counter;
    private Score score;
    private String name;
    
    /**
     * @param counter
     * @param score
     */
    
    public Rule(Score score, String name) {
        super();
        this.counter = 0;
        this.score = score;
        this.name = name;
    }
    
    @Override
    public abstract void checkConditions(String dataEntry);
    
    @Override
    public abstract void checkClauses(char character);
    
    /**
     * 
     * @return the counter
     */
    
    public int getCounter() {
        return counter;
    }
    
    /**
     * @param counter the counter to set
     */
    public void setCounter(int counter) {
        this.counter = counter;
    }
    
    public void setScore(Score score) {
        this.score = score;
    }
    
    public Score getScore() {
        return score;
    }
    
    @Override
    public void applyScore() {
        this.score.applyScore(getCounter());
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    
}
